﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Forums.UserControls
{
    public partial class Menu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void signout_Click(object sender, EventArgs e)
        {
            //wipe the session and cookies clean
            Session["User"] = null;
            Session.Clear();
            HttpCookie cookie = Request.Cookies["User"];

            //cookie expires now
            Response.Cookies["User"].Expires = DateTime.Now.AddYears(-1);
            
            Response.Redirect("/HomePage.aspx");
        }
    }
}